package com.cstar.learnlang.RowMappers;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.cstar.learnlang.DataForms.NewVocabularyListDataForm;
import com.cstar.learnlang.DataForms.UserInfoObj;
import java.sql.ResultSet;
import java.sql.SQLException;
 
import org.springframework.jdbc.core.RowMapper;

public class UserVocListRowMapper implements RowMapper {
	private static final Logger logger = LoggerFactory.getLogger(UserInfoObj.class);

	@Override
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		NewVocabularyListDataForm data = new NewVocabularyListDataForm();
		data.setRowId(rs.getString("Id"));
		data.setName(rs.getString("NAME"));
		data.setTags(rs.getString("TAGS"));
		data.setUserId(rs.getString("USER_ID"));
		data.setWordsList(rs.getString("WORDS"));
		data.setFromLang(rs.getString("FROM_LANG"));
		data.setToLang(rs.getString("TO_LANG"));
		data.setFromLangText(rs.getString("FROM_LANG_TEXT"));
		data.setToLangText(rs.getString("TO_LANG_TEXT"));
		return data;
	}
}
